using Wolfpack.Core;
using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core.Notification.Filters.Request;

namespace Wolfpack.Contrib.Checks.RabbitMQ
{
    public class RabbitQueueInfoConfigurationDiscovery : HealthCheckDiscoveryBase<RabbitQueueInfoCheckConfig, RabbitQueueInfoCheck>
    {
        protected override RabbitQueueInfoCheckConfig GetConfiguration()
        {
            return new RabbitQueueInfoCheckConfig
            {
                Enabled = true,
                FriendlyId = "CHANGEME!",
                NotificationMode = StateChangeNotificationFilter.FilterName,
                NotificationThreshold = 0,
                HostName = "CHANGEME!",
                Port = 5672,
                VirtualHost = "/",
                Queue = "CHANGEME!",
                Username = "guest",
                Password = "guest"
            };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "RabbitQueueInfoCheck";
            entry.Description = "This check will monitor a RabbitMQ Queue for breaches of too many items. If there are more items than the threshold set it will generate failure notifications.";
            entry.Tags.AddIfMissing("RabbitMQ", "Threshold", "Queues");
        }
    }
}